package com.homedo.microservice.open.service.gateway.manager.web.gateway.persistence.dao;

import com.homedo.common.dao.BaseDao;
import com.homedo.microservice.open.service.gateway.manager.web.gateway.bean.po.ConfigRelation;
import com.homedo.microservice.open.service.gateway.manager.web.gateway.persistence.mapper.IConfigRelationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;

import java.util.List;


/**
 * @author 作者 jgshun
 * @date 创建时间 2018年09月28日 13时53分50秒
 */
@Repository
public class ConfigRelationDao extends BaseDao<ConfigRelation> {
    @Autowired
    private IConfigRelationMapper configRelationMapper;

    public List<ConfigRelation> getList(String applicationName, List<String> zuulFilterIds) {
        Example example = new Example(ConfigRelation.class);

        example.createCriteria().andEqualTo(ConfigRelation.FIELD_APPLICATIONNAME, applicationName).andIn(ConfigRelation.FIELD_ZUULFILTERID, zuulFilterIds);

        return super.getListByExample(example);
    }
}
